<?php



class Subir extends CI_Controller {

	function __construct()
	{
		parent::__construct();
		$this->load->helper(array('form', 'url'));
                $this->load->database();
        $this->load->library('session');
	}

	function index()
	{
		$this->load->view('home/header.php');
        $this->load->view('home/subir_imagen.php',$error);
        $this->load->view('home/footer.php');
	}
	function do_upload()
	{
            		
		$config['upload_path'] = './public/images/cursos/';
		$config['allowed_types'] = 'gif|jpg|png';
		$config['max_size']	= '2000';
		$config['max_width']  = '123123';
		$config['max_height']  = '123131';

		$this->load->library('upload', $config);

		if ( ! $this->upload->do_upload())
		{
			print_r($error = array('error' => $this->upload->display_errors()));

			
                        
                 redirect('registro/subir_imagen');
        
		}
		else
		{
			$data = array('upload_data' => $this->upload->data());
$this->load->view('home/header.php');
        $this->load->view('home/subida_imagen.php',$data);
        $this->load->view('home/footer.php');
			
		}
	}
}
?>